package globals;
import graphics.GraphicalObject;

import java.util.Collection;
import java.util.HashMap;

import physics.GameObject;


public class GlobalObjects {
	public static final Object synchronizer = new Object();
	
	private final static HashMap<String, GraphicalObject> graphicalObjects = new HashMap<String, GraphicalObject>();
	private final static HashMap<String, GameObject> gameObjects = new HashMap<String, GameObject>();
	
	public static GraphicalObject getGraphic(String name){
		return graphicalObjects.get(name);
	}
	public static GraphicalObject putGraphic(String name,GraphicalObject object){
		return graphicalObjects.put(name, object);
	}
	public static GameObject getGameObject(String name){
		return gameObjects.get(name);
	}
	public static GameObject putGameObject(String name,GameObject object){
		return gameObjects.put(name, object);
	}
	public static Collection<GraphicalObject> getGraphicals(){
		return graphicalObjects.values();
	}

	public static void clearData(){
		graphicalObjects.clear();
		gameObjects.clear();
	}

}
